#!/bin/bash
set -euo pipefail
#==============================================================#
# File      :   supa-kick
# Desc      :   used by supabase, use dummy update to kick lag
# Ctime     :   2025-05-08
# Mtime     :   2025-09-07
# Path      :   /pg/bin/supa-kick
# Deps      :   psql
# Docs      :   https://github.com/pgsty/pigsty/issues/581
# License   :   AGPLv3 @ https://doc.pgsty.com/about/license
# Copyright :   2018-2025  Ruohang Feng / Vonng (rh@vonng.com)
#==============================================================#

# perform regular dummy update on supabase _analytics table to kick the stupid lag feedback
psql supabase -Atqwc 'update _analytics.users SET id = 1 where id = 1;'